.class public Lcom/netease/netstat/statistics/StatisticsService;
.super Ljava/lang/Object;
.source "StatisticsService.java"


# instance fields
.field DownLinkThroughout:Ljava/lang/Thread;

.field LocalIp:Ljava/lang/Thread;

.field LookUpDns:Ljava/lang/Thread;

.field LookUpJson:Ljava/lang/Thread;

.field NetWorkInfo:Ljava/lang/Thread;

.field Sendserver:Ljava/lang/Thread;

.field Tcphandshake_Httpgetlatency:Ljava/lang/Thread;

.field private basetest:Lcom/netease/netstat/statistics/BaseTest;

.field private cellloc:Lcom/netease/netstat/statistics/CellLocationTest;

.field private connectivity:Landroid/net/ConnectivityManager;

.field public context:Landroid/content/Context;

.field private downlink:Lcom/netease/netstat/statistics/DownLinkThroughoutTest;

.field private file:Lcom/netease/netstat/utils/FileService;

.field private json:Lcom/netease/netstat/statistics/JsonGetTime;

.field private localip:Lcom/netease/netstat/statistics/LocalIpTest;

.field private lookdns:Lcom/netease/netstat/statistics/LookUpDnsTest;

.field private networkinfo:Lcom/netease/netstat/statistics/NetWorkInfoTest;

.field private tcp:Lcom/netease/netstat/statistics/TcphandshakeHttpgetlatencyTest;

.field private telephony:Landroid/telephony/TelephonyManager;

.field private util:Lcom/netease/netstat/utils/Util;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2
    .parameter "context"

    .prologue
    .line 32
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 97
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/netstat/statistics/StatisticsService$1;

    invoke-direct {v1, p0}, Lcom/netease/netstat/statistics/StatisticsService$1;-><init>(Lcom/netease/netstat/statistics/StatisticsService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->Sendserver:Ljava/lang/Thread;

    .line 106
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/netstat/statistics/StatisticsService$2;

    invoke-direct {v1, p0}, Lcom/netease/netstat/statistics/StatisticsService$2;-><init>(Lcom/netease/netstat/statistics/StatisticsService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->DownLinkThroughout:Ljava/lang/Thread;

    .line 134
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/netstat/statistics/StatisticsService$3;

    invoke-direct {v1, p0}, Lcom/netease/netstat/statistics/StatisticsService$3;-><init>(Lcom/netease/netstat/statistics/StatisticsService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->LocalIp:Ljava/lang/Thread;

    .line 142
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/netstat/statistics/StatisticsService$4;

    invoke-direct {v1, p0}, Lcom/netease/netstat/statistics/StatisticsService$4;-><init>(Lcom/netease/netstat/statistics/StatisticsService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->LookUpDns:Ljava/lang/Thread;

    .line 165
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/netstat/statistics/StatisticsService$5;

    invoke-direct {v1, p0}, Lcom/netease/netstat/statistics/StatisticsService$5;-><init>(Lcom/netease/netstat/statistics/StatisticsService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->NetWorkInfo:Ljava/lang/Thread;

    .line 174
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/netstat/statistics/StatisticsService$6;

    invoke-direct {v1, p0}, Lcom/netease/netstat/statistics/StatisticsService$6;-><init>(Lcom/netease/netstat/statistics/StatisticsService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->Tcphandshake_Httpgetlatency:Ljava/lang/Thread;

    .line 200
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/netstat/statistics/StatisticsService$7;

    invoke-direct {v1, p0}, Lcom/netease/netstat/statistics/StatisticsService$7;-><init>(Lcom/netease/netstat/statistics/StatisticsService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->LookUpJson:Ljava/lang/Thread;

    .line 34
    const-string v0, "phone"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/telephony/TelephonyManager;

    .line 33
    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->telephony:Landroid/telephony/TelephonyManager;

    .line 36
    const-string v0, "connectivity"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/net/ConnectivityManager;

    .line 35
    iput-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->connectivity:Landroid/net/ConnectivityManager;

    .line 37
    iput-object p1, p0, Lcom/netease/netstat/statistics/StatisticsService;->context:Landroid/content/Context;

    .line 38
    return-void
.end method

.method static synthetic access$0(Lcom/netease/netstat/statistics/StatisticsService;)Landroid/telephony/TelephonyManager;
    .locals 1
    .parameter

    .prologue
    .line 16
    iget-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->telephony:Landroid/telephony/TelephonyManager;

    return-object v0
.end method

.method static synthetic access$1(Lcom/netease/netstat/statistics/StatisticsService;)Landroid/net/ConnectivityManager;
    .locals 1
    .parameter

    .prologue
    .line 18
    iget-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->connectivity:Landroid/net/ConnectivityManager;

    return-object v0
.end method

.method static synthetic access$10(Lcom/netease/netstat/statistics/StatisticsService;)Lcom/netease/netstat/statistics/NetWorkInfoTest;
    .locals 1
    .parameter

    .prologue
    .line 23
    iget-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->networkinfo:Lcom/netease/netstat/statistics/NetWorkInfoTest;

    return-object v0
.end method

.method static synthetic access$11(Lcom/netease/netstat/statistics/StatisticsService;Lcom/netease/netstat/statistics/TcphandshakeHttpgetlatencyTest;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 24
    iput-object p1, p0, Lcom/netease/netstat/statistics/StatisticsService;->tcp:Lcom/netease/netstat/statistics/TcphandshakeHttpgetlatencyTest;

    return-void
.end method

.method static synthetic access$12(Lcom/netease/netstat/statistics/StatisticsService;)Lcom/netease/netstat/statistics/TcphandshakeHttpgetlatencyTest;
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->tcp:Lcom/netease/netstat/statistics/TcphandshakeHttpgetlatencyTest;

    return-object v0
.end method

.method static synthetic access$2(Lcom/netease/netstat/statistics/StatisticsService;)Lcom/netease/netstat/utils/FileService;
    .locals 1
    .parameter

    .prologue
    .line 17
    iget-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    return-object v0
.end method

.method static synthetic access$3(Lcom/netease/netstat/statistics/StatisticsService;Lcom/netease/netstat/statistics/DownLinkThroughoutTest;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 20
    iput-object p1, p0, Lcom/netease/netstat/statistics/StatisticsService;->downlink:Lcom/netease/netstat/statistics/DownLinkThroughoutTest;

    return-void
.end method

.method static synthetic access$4(Lcom/netease/netstat/statistics/StatisticsService;)Lcom/netease/netstat/statistics/DownLinkThroughoutTest;
    .locals 1
    .parameter

    .prologue
    .line 20
    iget-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->downlink:Lcom/netease/netstat/statistics/DownLinkThroughoutTest;

    return-object v0
.end method

.method static synthetic access$5(Lcom/netease/netstat/statistics/StatisticsService;Lcom/netease/netstat/statistics/LocalIpTest;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 21
    iput-object p1, p0, Lcom/netease/netstat/statistics/StatisticsService;->localip:Lcom/netease/netstat/statistics/LocalIpTest;

    return-void
.end method

.method static synthetic access$6(Lcom/netease/netstat/statistics/StatisticsService;)Lcom/netease/netstat/statistics/LocalIpTest;
    .locals 1
    .parameter

    .prologue
    .line 21
    iget-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->localip:Lcom/netease/netstat/statistics/LocalIpTest;

    return-object v0
.end method

.method static synthetic access$7(Lcom/netease/netstat/statistics/StatisticsService;Lcom/netease/netstat/statistics/LookUpDnsTest;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 22
    iput-object p1, p0, Lcom/netease/netstat/statistics/StatisticsService;->lookdns:Lcom/netease/netstat/statistics/LookUpDnsTest;

    return-void
.end method

.method static synthetic access$8(Lcom/netease/netstat/statistics/StatisticsService;)Lcom/netease/netstat/statistics/LookUpDnsTest;
    .locals 1
    .parameter

    .prologue
    .line 22
    iget-object v0, p0, Lcom/netease/netstat/statistics/StatisticsService;->lookdns:Lcom/netease/netstat/statistics/LookUpDnsTest;

    return-object v0
.end method

.method static synthetic access$9(Lcom/netease/netstat/statistics/StatisticsService;Lcom/netease/netstat/statistics/NetWorkInfoTest;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 23
    iput-object p1, p0, Lcom/netease/netstat/statistics/StatisticsService;->networkinfo:Lcom/netease/netstat/statistics/NetWorkInfoTest;

    return-void
.end method


# virtual methods
.method public start()V
    .locals 8

    .prologue
    .line 41
    const-wide/16 v2, 0x0

    .line 42
    .local v2, nexttime:J
    new-instance v4, Lcom/netease/netstat/utils/FileService;

    iget-object v5, p0, Lcom/netease/netstat/statistics/StatisticsService;->context:Landroid/content/Context;

    invoke-direct {v4, v5}, Lcom/netease/netstat/utils/FileService;-><init>(Landroid/content/Context;)V

    iput-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    .line 44
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 50
    .local v0, currenttime:J
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    const-string v5, "next_time"

    invoke-virtual {v4, v5}, Lcom/netease/netstat/utils/FileService;->readXML(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v4

    if-gtz v4, :cond_4

    .line 51
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    const-string v5, "Time.xml"

    iget-object v6, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    const-string v7, "123"

    invoke-virtual {v6, v7}, Lcom/netease/netstat/utils/FileService;->WriteXmlStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v5, v6}, Lcom/netease/netstat/utils/FileService;->WriteFileData(Ljava/lang/String;Ljava/lang/String;)V

    .line 54
    :goto_0
    new-instance v4, Lcom/netease/netstat/utils/Util;

    iget-object v5, p0, Lcom/netease/netstat/statistics/StatisticsService;->context:Landroid/content/Context;

    invoke-direct {v4, v5}, Lcom/netease/netstat/utils/Util;-><init>(Landroid/content/Context;)V

    iput-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->util:Lcom/netease/netstat/utils/Util;

    .line 57
    cmp-long v4, v0, v2

    if-ltz v4, :cond_3

    .line 58
    const-wide/32 v4, 0x36ee80

    add-long v2, v0, v4

    .line 60
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    const-string v5, "Time.xml"

    .line 61
    iget-object v6, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Lcom/netease/netstat/utils/FileService;->WriteXmlStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    .line 60
    invoke-virtual {v4, v5, v6}, Lcom/netease/netstat/utils/FileService;->WriteFileData(Ljava/lang/String;Ljava/lang/String;)V

    .line 63
    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4}, Lorg/json/JSONObject;-><init>()V

    sput-object v4, Lcom/netease/netstat/utils/Contanst;->obj:Lorg/json/JSONObject;

    .line 65
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->util:Lcom/netease/netstat/utils/Util;

    invoke-virtual {v4}, Lcom/netease/netstat/utils/Util;->checkairline()V

    .line 66
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->util:Lcom/netease/netstat/utils/Util;

    invoke-virtual {v4}, Lcom/netease/netstat/utils/Util;->isNetworkAvailable()V

    .line 68
    sget-boolean v4, Lcom/netease/netstat/utils/Contanst;->airline:Z

    if-nez v4, :cond_0

    sget-boolean v4, Lcom/netease/netstat/utils/Contanst;->connectivity:Z

    if-eqz v4, :cond_0

    .line 69
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->util:Lcom/netease/netstat/utils/Util;

    sget-object v5, Lcom/netease/netstat/utils/Contanst;->checkflag:Ljava/lang/String;

    invoke-virtual {v4, v5}, Lcom/netease/netstat/utils/Util;->checkTest(Ljava/lang/String;)I

    .line 72
    :cond_0
    new-instance v4, Lcom/netease/netstat/statistics/BaseTest;

    iget-object v5, p0, Lcom/netease/netstat/statistics/StatisticsService;->telephony:Landroid/telephony/TelephonyManager;

    iget-object v6, p0, Lcom/netease/netstat/statistics/StatisticsService;->connectivity:Landroid/net/ConnectivityManager;

    iget-object v7, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    invoke-direct {v4, v5, v6, v7}, Lcom/netease/netstat/statistics/BaseTest;-><init>(Landroid/telephony/TelephonyManager;Landroid/net/ConnectivityManager;Lcom/netease/netstat/utils/FileService;)V

    iput-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->basetest:Lcom/netease/netstat/statistics/BaseTest;

    .line 76
    sget-boolean v4, Lcom/netease/netstat/utils/Contanst;->airline:Z

    if-nez v4, :cond_3

    sget-object v4, Lcom/netease/netstat/utils/Contanst;->checkstatistic:Lcom/netease/netstat/utils/CheckStatistic;

    iget-object v4, v4, Lcom/netease/netstat/utils/CheckStatistic;->checktest:Ljava/lang/Boolean;

    invoke-virtual {v4}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v4

    if-eqz v4, :cond_3

    .line 77
    new-instance v4, Lcom/netease/netstat/statistics/CellLocationTest;

    iget-object v5, p0, Lcom/netease/netstat/statistics/StatisticsService;->telephony:Landroid/telephony/TelephonyManager;

    iget-object v6, p0, Lcom/netease/netstat/statistics/StatisticsService;->connectivity:Landroid/net/ConnectivityManager;

    iget-object v7, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    invoke-direct {v4, v5, v6, v7}, Lcom/netease/netstat/statistics/CellLocationTest;-><init>(Landroid/telephony/TelephonyManager;Landroid/net/ConnectivityManager;Lcom/netease/netstat/utils/FileService;)V

    iput-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->cellloc:Lcom/netease/netstat/statistics/CellLocationTest;

    .line 78
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->cellloc:Lcom/netease/netstat/statistics/CellLocationTest;

    invoke-virtual {v4}, Lcom/netease/netstat/statistics/CellLocationTest;->getLocation()V

    .line 80
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->NetWorkInfo:Ljava/lang/Thread;

    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    .line 83
    sget-boolean v4, Lcom/netease/netstat/utils/Contanst;->connectivity:Z

    if-eqz v4, :cond_2

    .line 85
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->LookUpDns:Ljava/lang/Thread;

    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    .line 86
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->LocalIp:Ljava/lang/Thread;

    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    .line 87
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->Tcphandshake_Httpgetlatency:Ljava/lang/Thread;

    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    .line 88
    sget-object v4, Lcom/netease/netstat/utils/Contanst;->checkstatistic:Lcom/netease/netstat/utils/CheckStatistic;

    invoke-virtual {v4}, Lcom/netease/netstat/utils/CheckStatistic;->getCheckdownlink()Ljava/lang/Boolean;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 89
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->DownLinkThroughout:Ljava/lang/Thread;

    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    .line 90
    :cond_1
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->LookUpJson:Ljava/lang/Thread;

    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    .line 92
    :cond_2
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->Sendserver:Ljava/lang/Thread;

    invoke-virtual {v4}, Ljava/lang/Thread;->start()V

    .line 95
    :cond_3
    return-void

    .line 53
    :cond_4
    iget-object v4, p0, Lcom/netease/netstat/statistics/StatisticsService;->file:Lcom/netease/netstat/utils/FileService;

    const-string v5, "next_time"

    invoke-virtual {v4, v5}, Lcom/netease/netstat/utils/FileService;->readXML(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v2

    goto/16 :goto_0
.end method
